
#ifndef _MAINWINDOW_H
#define _MAINWINDOW_H

#include <QMainWindow>

class QAction;
class QMenu;
class QListWidget;
class QDockWidget;
class QHBoxLayout;
class QHttp;
class QFile;

#include "maininterface.h"

namespace PBVP {
	class DataManager;
	class DataManagerView;
	class RenderManager;
	class FileExtensionManager;
	class RenderManagerView;
	class ZGLWidget;

	class MainWindow : public QMainWindow
	{
		Q_OBJECT

	public:
		/// Constructor
		MainWindow();
		/// Destructor
		virtual ~MainWindow();

		/// Return the datamanager
		DataManager* getDataManager() {
			return m_pDataManager;
		}
		/// Return pointer to the render manager
		RenderManager* getRenderManager() {
			return m_pRenderManager;
		}

		///
		QDockWidget *propDock;

	public slots:
		///
		void updateView();

	private slots:
		///
		void open();
		
		///
		void about();
		
		///
		void toggleFullScreen();
		
		///
		void editEnvironment();
		
		///
		void saveImage();
		
		///
		void downloadPDB();
		
		/// 
		void downloadPDBFinished(bool error);

	private:
		void createActions();
		void createMenus();
		void createToolBars();
		void createStatusBar();
		void createDockWindows();

		void loadPlugins();

		QMenu *fileMenu;
		QMenu *viewMenu;
		QMenu *editMenu;
		QMenu *helpMenu;
		QMenu *pluginMenu;

		QAction *fileOpenAction;
		QAction *fullScreenAction;
		QAction *environmentAction;
		QAction *aboutAction;
		QAction *exitAction;
		QAction *imageSaveAction;
		QAction *showBBoxAction;
		QAction *downloadPDBAction;

		QToolBar *fileToolBar;
		QToolBar *helpToolBar;

		QHttp *http;
		QFile *pdbPath;

		DataManagerView *dataList;
		RenderManagerView *renderView;

		///
		ZGLWidget *zGLWidget;

		///
		MainInterface *m_pMainInterface;
		/// 
		FileExtensionManager *m_pFileExtManager;
		/// 
		DataManager *m_pDataManager;
		/// 
		RenderManager *m_pRenderManager;
	};

}
#endif

